package com.example.shiro.model.sys.mapper;

import com.example.shiro.model.sys.entity.UserEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.shiro.model.sys.entity.dto.UserInfoDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 用户基本信息表 Mapper 接口
 * </p>
 *
 * @author jatej
 * @since 2020-04-16
 */
@Mapper
public interface UserMapper extends BaseMapper<UserEntity> {

    /**
     * 通过用户名查询用户登录信息
     * @param username
     * @return
     */
    @Select("SELECT user_id, username, password, status FROM sys_user WHERE username = #{username}")
    UserInfoDto getUserInfoByUsername( @Param("username") String username  );

    /**
     * 通过用户名获取用户信息
     * @param username
     * @return
     */
    UserEntity getUserByUserName( String username );
}
